home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / utilities / blankers / blitzblank_260 / developer / modulesources / bb.splines.c < prev    next >
C/C++ Source or Header  |  1995-02-26  |  4KB  |  150 lines

  1.  
  2. /* Beispiel für eine GUI, noch ohne Blank-Funktion */
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <dos/dos.h>
  8. #include <exec/memory.h>
  9. #include <intuition/intuitionbase.h>
  10. #include <intuition/screens.h>
  11. #include <intuition/intuition.h>
  12. #include <proto/exec.h>
  13. #include <proto/intuition.h>
  14. #include <proto/graphics.h>
  15. #include <pragmas/blitzblank_pragmas.h>
  16. #include <BlitzBlank.h>
  17.  
  18. struct Library *BlitzBlankBase;
  19. char *VersionString="$VER: BB.Splines 2.50 (25.12.94)";
  20.  
  21. char *text[]={"\33c\33uSplines\33n\n\nModule for BlitzBlank\n\nCopyright 1994\nby\nJürgen Denner",
  22.               "Straight",
  23.               "Bouncing",
  24.               "Various",
  25.               "_Fixpoints:",
  26.               "Sp_lines:",
  27.               "Spli_ne Speed:",
  28.               "_Random Range:" };
  29.  
  30.  
  31. char *pgrouplabels[4];
  32.  
  33. struct BB_Object object[]={ {&object[ 1],BB_PGroup,0,0,1,NULL,(char *)pgrouplabels},
  34.                             {&object[ 2],BB_VGroup,0,0,0,NULL,NULL},
  35.                             {&object[ 3],BB_Slider,10,30,22,NULL,NULL},
  36.                             {&object[ 4],BB_Slider,10,99,43,NULL,NULL},
  37.                             {&object[ 5],BB_Slider,0,20,19,NULL,NULL},
  38.                             {&object[ 6],BB_Slider,3,40,5,NULL,NULL},
  39.                             {&object[ 7],BB_VGroup_End,0,0,0,NULL,NULL},
  40.                             {&object[ 8],BB_VGroup,0,0,0,NULL,NULL},
  41.                             {&object[ 9],BB_Slider,10,30,20,NULL,NULL},
  42.                             {&object[10],BB_Slider,10,99,33,NULL,NULL},
  43.                             {&object[11],BB_Slider,0,20,20,NULL,NULL},
  44.                             {&object[12],BB_Slider,3,40,6,NULL,NULL},
  45.                             {&object[13],BB_VGroup_End,0,0,0,NULL,NULL},
  46.                             {&object[14],BB_VGroup,0,0,0,NULL,NULL},
  47.                             {&object[15],BB_Slider,10,30,17,NULL,NULL},
  48.                             {&object[16],BB_Slider,10,99,52,NULL,NULL},
  49.                             {&object[17],BB_Slider,0,20,20,NULL,NULL},
  50.                             {&object[18],BB_Slider,3,40,5,NULL,NULL},
  51.                             {&object[19],BB_VGroup_End,0,0,0,NULL,NULL},
  52.                             {NULL       ,BB_PGroup_End,0,0,0,NULL,NULL} };
  53.  
  54.  
  55.  
  56. struct BB_Message message;
  57.  
  58. struct BB_Screeninfo *screeninfo;
  59.  
  60.  
  61. void blank (void)
  62. {
  63.   struct RastPort *rp;
  64.   struct ViewPort *vp;
  65.  
  66. // screeninfo->width    = Breite
  67. // screeninfo->height   = Höhe
  68. // screeninfo->depth    = Tiefe
  69. // screeninfo->bbscreen = Screenstruktur
  70.  
  71. // object[ 0].set       = Modus (0/1/2)
  72.  
  73. // object[ 2].set       = Modus 0, Fixpoints
  74. // object[ 3].set       = Modus 0, Splines
  75. // object[ 4].set       = Modus 0, Spline Speed
  76. // object[ 5].set       = Modus 0, Random Range
  77.  
  78. // object[ 8].set       = Modus 1, Fixpoints
  79. // object[ 9].set       = Modus 1, Splines
  80. // object[10].set       = Modus 1, Spline Speed
  81. // object[11].set       = Modus 1, Random Range
  82.  
  83. // object[14].set       = Modus 2, Fixpoints
  84. // object[15].set       = Modus 2, Splines
  85. // object[16].set       = Modus 2, Spline Speed
  86. // object[17].set       = Modus 2, Random Range
  87.  
  88.  
  89.   rp=&screeninfo->bbscreen->RastPort;
  90.   vp=&screeninfo->bbscreen->ViewPort;
  91.  
  92.   SetRGB4 (vp,0,0,0,0);
  93.   SetRGB4 (vp,1,15,15,15);
  94.  
  95.   SetAPen (rp,1);
  96.   Move (rp,100,100);
  97.   Text (rp,"Dieses Modul hat noch keine Blankroutine!",41);
  98.  
  99.   ScreenToFront (screeninfo->bbscreen);
  100.   if (!CheckSignal (SIGBREAKF_CTRL_C))
  101.   {
  102.     BBL_ModuleRunning ();
  103.     Wait (SIGBREAKF_CTRL_C);
  104.   }
  105.   return;
  106. }
  107.  
  108.  
  109. void main(int argc,char **argv)
  110. {
  111.   int i;
  112.  
  113.   if (!(BlitzBlankBase=OpenLibrary ("blitzblank.library",BLITZBLANKLIB_VER)))
  114.     exit (0);
  115.  
  116.   message.flags=BBF_Screenmode;
  117.   message.first=&object[0];
  118.  
  119.   if (strcmp (argv[1],"BLANK")==0)
  120.   {
  121.     StrToLong (argv[3],(long *) &screeninfo);
  122.     screeninfo->depth=1;
  123.     BBL_SendMessage (&message,argv[2]);
  124.     if (screeninfo->bbscreen)
  125.       blank ();
  126.     BBL_BlankDone ();
  127.   }
  128.   else
  129.   {
  130.     message.infotext=BBL_GetString (310,text[0]);
  131.     for (i=1;i<=3;i++)
  132.       pgrouplabels[i-1]=BBL_GetString (310+i,text[i]);
  133.     pgrouplabels[3]=NULL;
  134.     for (i=4;i<=7;i++)
  135.       object[i-2].label=object[i+4].label=object[i+10].label=BBL_GetString (310+i,text[i]);
  136.     if (strcmp (argv[1],"CONFIG")==0)
  137.     {
  138.       BBL_SendMessage (&message,argv[2]);
  139.     }
  140.     else
  141.     {
  142.       message.first=NULL;
  143.       BBL_SendMessage (&message,argv[2]);
  144.     }
  145.   }
  146.   CloseLibrary (BlitzBlankBase);
  147.   exit (0);
  148. }
  149.  
  150.